<?php
$app = Blyn::app()->getActiveApp();
$messageList = array();
if ($eventId > 0) {
    $event = new BWEvent($eventId);
    $messageList = $event->getMessageManager()->getMessageList();
}
//Blyn::app()->getUIManager()->getCurrentScreen()->addContextVariable('eventId', $eventId);
//Blyn::app()->getUIManager()->getCurrentScreen()->addContextVariable('MmessageId', $MmessageId);
//
?>
<style>
.ui-block-a, 
.ui-block-b
{

background-color: lightgray;
border: 1px solid black;
//height: 100px;
font-weight: bold;
text-align: center;
padding: 10px;
}
</style>
  <div data-role="header">
  <h1>旅游管理</h1>
  </div>
<div data-role="content" style="padding:0px;">
       <p>美食列表：</p>
   <div class="ui-grid-b">
       <div class="ui-block-a" style="width:50%;"><span>名称</span></div>
       <div class="ui-block-b" style="width:50%;"><span>操作</span></div>
   </div>
   <?php foreach ($messageList as $message) {
//        $detailUrl = $control->getLinkUrl(array('name' => '修改','id' => 'showjqAddEvent'),array(
//            'eventId' => $event->id));
       ?>
    <div class="ui-grid-b">
     <div class="ui-block-a" style="border: 1px solid black;background-color:white;font-weight:normal;width:50%;"><span><?php echo $message->getName(); ?></span></div>
     <div class="ui-block-b" style="border: 1px solid black;background-color:white;font-weight:normal;width:50%;"><?php
      $detailUrl = $control->getLinkUrl(array('name' => '编辑','id' => 'showjqAddFood'), array('eventId' => $eventId, 'messageId' => $message->getId()));
      ?><span><a href="<?php echo $detailUrl;?>">编辑</a></span></div>
   </div>
   <?php } ?>
   <div data-role="controlgroup" data-type="horizontal" style="padding:1px;">
        <?php
        $newAddUrl = $control->getLinkUrl(array('name' => '添加美食','id' => 'showjqAddFood'),array(
          'eventId' => $eventId,'messageId' => 0,));
        ?>
       <a href="<?php echo $newAddUrl; ?>" data-role="button"><?php echo "添加美食"; ?></a>   
    <a href="#" data-role="button">删除</a>
    </div>
</div>
<div data-role="footer" data-position="fixed" data-theme="a" class="ui-footer ui-bar-a ui-footer-fixed slideup ui-fixed-hidden" role="contentinfo">
  <h1 class="ui-title" role="heading" aria-level="1">Copyright billyn.net</h1>
 </div>



